{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# This allows multiple outputs from a single jupyter notebook cell:\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\"\n",
    "import pandas as pd\n",
    "import mplfinance as mpf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/bb/mbigd/mbig5/jupven/mplfinance/src/mplfinance/__init__.py'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mpf.__file__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(20, 5)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-01</th>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.95</td>\n",
       "      <td>3050.72</td>\n",
       "      <td>3066.91</td>\n",
       "      <td>510301237</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-04</th>\n",
       "      <td>3078.96</td>\n",
       "      <td>3085.20</td>\n",
       "      <td>3074.87</td>\n",
       "      <td>3078.27</td>\n",
       "      <td>524848878</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Open     High      Low    Close     Volume\n",
       "Date                                                     \n",
       "2019-11-01  3050.72  3066.95  3050.72  3066.91  510301237\n",
       "2019-11-04  3078.96  3085.20  3074.87  3078.27  524848878"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-11-27</th>\n",
       "      <td>3145.49</td>\n",
       "      <td>3154.26</td>\n",
       "      <td>3143.41</td>\n",
       "      <td>3153.63</td>\n",
       "      <td>421853938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-11-29</th>\n",
       "      <td>3147.18</td>\n",
       "      <td>3150.30</td>\n",
       "      <td>3139.34</td>\n",
       "      <td>3140.98</td>\n",
       "      <td>286602291</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               Open     High      Low    Close     Volume\n",
       "Date                                                     \n",
       "2019-11-27  3145.49  3154.26  3143.41  3153.63  421853938\n",
       "2019-11-29  3147.18  3150.30  3139.34  3140.98  286602291"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "daily = pd.read_csv('../data/SP500_NOV2019_Hist.csv',index_col=0,parse_dates=True)\n",
    "daily.index.name = 'Date'\n",
    "daily.shape\n",
    "daily.head(2)\n",
    "daily.tail(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "axes.grid= True\n",
      "axes.grid.axis= both\n",
      "axes.grid.which= major\n",
      "grid.alpha= 1.0\n",
      "grid.color= white\n",
      "grid.linestyle= -\n",
      "grid.linewidth= 0.8\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjYAAAHICAYAAABdxqDBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3dfVyVdZ7/8fcBPEeQQNRAQzAVFZ2mZkpTctJJc0CjHG1qUUqW1p2WKXfHh6npLJnduFZjZgb7qJ2ZFW+astAtw4GasfKxuaDRjTkzpCISiSkKFSD35/z+8Ocp8gY0zs315fV8PHok57rO4XPx8ejbz/W9rmNzuVwuAQAAGCDA1wUAAAB0FYINAAAwBsEGAAAYg2ADAACMQbABAADGCPJ1AZ704x//WFVVVYqLi/N1KQAAoIscPHhQl19+uT788MOzthkdbKqqqvT117VqaGr1dSmdYg8KUHOr09dl4CLRN2uib9ZDz6zJE337+uva824zOt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AwBsEGAAAYg2ADAACMQbABAADGINgAAABjEGwAAIAxCDYAAMAYBBsAAGAMgg0AADAGwQYAABiDYAMAAIxBsAEAAMYg2AAAAGN4NdgUFBRo+vTpSkpK0qxZs7R//35J0rp16zR16lQlJibqN7/5jZqbm93PefHFFzVp0iRNmjRJDz30kFpaWiRJlZWVSk9PV2JiombMmKHCwkJvHgoAAPBDXgs2lZWVWrZsmbKzs5Wfn6+kpCQtXbpUH330kdavX6+XX35Z+fn5qq2t1YYNGyRJ77//vtatW6dXX31Vb775purr6/XBBx9IkjIzMzVx4kQVFBRoxYoVWrBggRobG711OAAAwA95LdgEBQVp1apVio6OliQlJCSorKxM+fn5mjZtmsLCwmSz2XT77bcrPz9fkrRlyxb9wz/8g/r06eN+/tixY1VbW6uioiLdeeedkqSRI0dqwIABKioq8tbhAAAAP+S1YBMZGanx48dLklpbW7V161ZNnjxZhw8fVmxsrHu/mJgYHTp0SJJUUlKiU6dOafbs2UpMTNTTTz+ttrY2lZeXKyIiQiEhIe7nxcbGqqyszFuHAwAA/FCQt79hTk6OsrOzFRsbq6ysLC1cuFB2u929vWfPnmpoaJAk1dbWqri4WC+88IKam5uVlpammJgYDR48WA6Ho93rOhwOnTp16qzvZw8KUHRkqGcPqgtZqVacZg8KpG8WRN+sh55Zkyf65rAHnneb14NNWlqa5syZo7y8PKWkpGjQoEHtFgs3NDS4JzGXXXaZbrnlFoWGnv6BzJw5U//7v/+rUaNGqampqd3rNjY2tpvgnNHc6tSR43UePKKuZaVacVp0ZCh9syD6Zj30zJo80bem5jYFO84dYbx2Kqq0tFS7du2SJNlsNiUnJ6u+vl42m03l5eXu/crLyxUXFydJuuKKK1RX980PIyAgQIGBgRo0aJBqampUX19/zucBAIDuyWvBprq6WosWLdKxY8ckScXFxWppaVFGRoby8vJ04sQJtba2av369brlllskSdOmTdPmzZtVW1urxsZGvf7660pISFBoaKjGjx/vvnqqsLBQVVVVuv766711OAAAwA957VTUmDFjlJGRofT0dDmdTtntdq1evVp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344IOy2+1666239Ne//lUbN25USEiIXn31VblcLo0dO1YSd830NfpmPfTMmugbvIkb9HWRYcOG6Q9/+INmz56twMBApaSk6KabbpLL5dLOnTtVXV2thoYGTZs2TRJvWH9B36yHnlkTfYO3cCqqi3388cdKTU3VAw88oH/8x39st83lcvFm9VP0zXromTXRN3gap6K6WP/+/TV+/Hg98MADCg8P19VXX91uO29a/0TfrIeeWRN9g6cRbDygf//++slPfqJ58+bp8ssv11VXXSWJN6y/o2/WQ8+sib7BkzgV5UH79u1TcHAwlytaDH2zHnpmTfQNnkCwAQAAxuAmAQAAwBgEGwAAYAyCDQAAMAbBBgAAGINgAwAAjEGwAQAAxiDYAAAAYxBsAACAMf4fxjXyMkhBlW8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 720x576 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "mpf.plot(daily)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib as mpl\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.rcParams == mpl.rcParams"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing rcp_to_df.py\n"
     ]
    }
   ],
   "source": [
    "#%%writefile rcp_to_df.py\n",
    "def rcParams_to_df(rcp,name=None):\n",
    "    keys = []\n",
    "    vals = []\n",
    "    for item in rcp:\n",
    "        keys.append(item)\n",
    "        vals.append(rcp[item])\n",
    "    df = pd.DataFrame(vals,index=pd.Index(keys,name='rcParams Key'))\n",
    "    if name is not None:\n",
    "        df.columns = [name]\n",
    "    else:\n",
    "        df.columns = ['Value']\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = rcParams_to_df(mpl.rcParams)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Value</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rcParams Key</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>_internal.classic_mode</th>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>agg.path.chunksize</th>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>animation.avconv_args</th>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>animation.avconv_path</th>\n",
       "      <td>avconv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>animation.bitrate</th>\n",
       "      <td>-1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                         Value\n",
       "rcParams Key                  \n",
       "_internal.classic_mode   False\n",
       "agg.path.chunksize           0\n",
       "animation.avconv_args       []\n",
       "animation.avconv_path   avconv\n",
       "animation.bitrate           -1"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Value</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rcParams Key</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>axes.prop_cycle</th>\n",
       "      <td>({'color': '#1f77b4'}, {'color': '#ff7f0e'}, {...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.boxprops.color</th>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.boxprops.linestyle</th>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.boxprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.capprops.color</th>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.capprops.linestyle</th>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.capprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.color</th>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.linestyle</th>\n",
       "      <td>none</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.marker</th>\n",
       "      <td>o</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.markeredgecolor</th>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.markeredgewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.markerfacecolor</th>\n",
       "      <td>none</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.flierprops.markersize</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.color</th>\n",
       "      <td>C2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.linestyle</th>\n",
       "      <td>--</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.marker</th>\n",
       "      <td>^</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.markeredgecolor</th>\n",
       "      <td>C2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.markerfacecolor</th>\n",
       "      <td>C2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.meanprops.markersize</th>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.medianprops.color</th>\n",
       "      <td>C1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.medianprops.linestyle</th>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.medianprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.whiskerprops.color</th>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.whiskerprops.linestyle</th>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>boxplot.whiskerprops.linewidth</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                Value\n",
       "rcParams Key                                                                         \n",
       "axes.prop_cycle                     ({'color': '#1f77b4'}, {'color': '#ff7f0e'}, {...\n",
       "boxplot.boxprops.color                                                          black\n",
       "boxplot.boxprops.linestyle                                                          -\n",
       "boxplot.boxprops.linewidth                                                          1\n",
       "boxplot.capprops.color                                                          black\n",
       "boxplot.capprops.linestyle                                                          -\n",
       "boxplot.capprops.linewidth                                                          1\n",
       "boxplot.flierprops.color                                                        black\n",
       "boxplot.flierprops.linestyle                                                     none\n",
       "boxplot.flierprops.linewidth                                                        1\n",
       "boxplot.flierprops.marker                                                           o\n",
       "boxplot.flierprops.markeredgecolor                                              black\n",
       "boxplot.flierprops.markeredgewidth                                                  1\n",
       "boxplot.flierprops.markerfacecolor                                               none\n",
       "boxplot.flierprops.markersize                                                       6\n",
       "boxplot.meanprops.color                                                            C2\n",
       "boxplot.meanprops.linestyle                                                        --\n",
       "boxplot.meanprops.linewidth                                                         1\n",
       "boxplot.meanprops.marker                                                            ^\n",
       "boxplot.meanprops.markeredgecolor                                                  C2\n",
       "boxplot.meanprops.markerfacecolor                                                  C2\n",
       "boxplot.meanprops.markersize                                                        6\n",
       "boxplot.medianprops.color                                                          C1\n",
       "boxplot.medianprops.linestyle                                                       -\n",
       "boxplot.medianprops.linewidth                                                       1\n",
       "boxplot.whiskerprops.color                                                      black\n",
       "boxplot.whiskerprops.linestyle                                                      -\n",
       "boxplot.whiskerprops.linewidth                                                      1"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df.index.str.contains('prop')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-11-a6774c8535dd>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-11-a6774c8535dd>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m    STOP HERE\u001b[0m\n\u001b[0m            ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "STOP HERE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[df.index.str.contains('cyc')]\n",
    "#df[df.index.str.contains('color')]\n",
    "df[df.index.str.contains('grid')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[df.index.str.contains('axes.prop')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[df.index.str.contains('grid')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "colors = [item['color'] for item in mpl.rcParams['axes.prop_cycle']]\n",
    "colors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[df.index.str.contains('bar')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = rcParams_to_df(mpl.rcParams)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "def rcparams_compare_styles(s1,s2):\n",
    "    with plt.rc_context():\n",
    "         plt.style.use('default')\n",
    "         plt.style.use(s1)\n",
    "         df1 = rcParams_to_df(plt.rcParams,name=s1)\n",
    "\n",
    "    with plt.rc_context():\n",
    "         plt.style.use('default')\n",
    "         plt.style.use(s2)\n",
    "         df2 = rcParams_to_df(plt.rcParams,name=s2)\n",
    "    \n",
    "    df  = pd.concat([df1,df2],axis=1)\n",
    "    dif = df[df[s1] != df[s2]].dropna(how='all')\n",
    "    \n",
    "    return (dif,df,df1,df2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "dfs = rcparams_compare_styles('fast','dark_background')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>fast</th>\n",
       "      <th>dark_background</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>rcParams Key</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>agg.path.chunksize</th>\n",
       "      <td>10000</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>axes.edgecolor</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>axes.facecolor</th>\n",
       "      <td>white</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>axes.labelcolor</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>axes.prop_cycle</th>\n",
       "      <td>({'color': '#1f77b4'}, {'color': '#ff7f0e'}, {...</td>\n",
       "      <td>({'color': '#8dd3c7'}, {'color': '#feffb3'}, {...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>figure.edgecolor</th>\n",
       "      <td>white</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>figure.facecolor</th>\n",
       "      <td>white</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>grid.color</th>\n",
       "      <td>#b0b0b0</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>lines.color</th>\n",
       "      <td>C0</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>patch.edgecolor</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>path.simplify_threshold</th>\n",
       "      <td>1</td>\n",
       "      <td>0.111111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>savefig.edgecolor</th>\n",
       "      <td>white</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>savefig.facecolor</th>\n",
       "      <td>white</td>\n",
       "      <td>black</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>text.color</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>xtick.color</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ytick.color</th>\n",
       "      <td>black</td>\n",
       "      <td>white</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                      fast  \\\n",
       "rcParams Key                                                                 \n",
       "agg.path.chunksize                                                   10000   \n",
       "axes.edgecolor                                                       black   \n",
       "axes.facecolor                                                       white   \n",
       "axes.labelcolor                                                      black   \n",
       "axes.prop_cycle          ({'color': '#1f77b4'}, {'color': '#ff7f0e'}, {...   \n",
       "figure.edgecolor                                                     white   \n",
       "figure.facecolor                                                     white   \n",
       "grid.color                                                         #b0b0b0   \n",
       "lines.color                                                             C0   \n",
       "patch.edgecolor                                                      black   \n",
       "path.simplify_threshold                                                  1   \n",
       "savefig.edgecolor                                                    white   \n",
       "savefig.facecolor                                                    white   \n",
       "text.color                                                           black   \n",
       "xtick.color                                                          black   \n",
       "ytick.color                                                          black   \n",
       "\n",
       "                                                           dark_background  \n",
       "rcParams Key                                                                \n",
       "agg.path.chunksize                                                       0  \n",
       "axes.edgecolor                                                       white  \n",
       "axes.facecolor                                                       black  \n",
       "axes.labelcolor                                                      white  \n",
       "axes.prop_cycle          ({'color': '#8dd3c7'}, {'color': '#feffb3'}, {...  \n",
       "figure.edgecolor                                                     black  \n",
       "figure.facecolor                                                     black  \n",
       "grid.color                                                           white  \n",
       "lines.color                                                          white  \n",
       "patch.edgecolor                                                      white  \n",
       "path.simplify_threshold                                           0.111111  \n",
       "savefig.edgecolor                                                    black  \n",
       "savefig.facecolor                                                    black  \n",
       "text.color                                                           white  \n",
       "xtick.color                                                          white  \n",
       "ytick.color                                                          white  "
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfs[0]\n",
    "len(dfs[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mybarplot():\n",
    "    fig = plt.figure()\n",
    "    ax  = fig.add_axes( [0.15,0.18,0.70,0.70])\n",
    "    x   = [jj for jj in range(0,10)]\n",
    "    y   = [random.randint(0,10) for jj in range(0,10)]\n",
    "    ax.bar(x,y,color='#dbdbdb')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.style.use('classic')\n",
    "mybarplot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.concat([d1,d2],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "diff = df[df['classic'] != df['fast']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "diff.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.style.use('seaborn-darkgrid')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = rcParams_to_df(mpl.rcParams)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for item in mpl.rcParams:\n",
    "    if 'grid' in item:\n",
    "        print(item,mpl.rcParams[item])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "type(mpl.rcParams['grid.linestyle'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1.columns = ['Val 1']\n",
    "df2.columns = ['Val 2']\n",
    "df = pd.concat([df1,df2],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ddf = df[ df['Val 1'] != df['Val 2'] ]\n",
    "ddf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ddf['Val 2']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ddf[ ddf.index.str.contains('grid') ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[df.index.str.contains('grid')]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "temp = dict(axes.edgecolor='black',axes.axisbelow=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "temp = { 'axes.edgecolor':'black','axes.axisbelow':True }\n",
    "temp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "mavcolors=['turquoise','gold','magenta']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib import colors as mcolors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for c in mavcolors:\n",
    "    rgba = mcolors.to_rgba(c,1.0)\n",
    "    h = mcolors.to_hex(c)\n",
    "    print(h,rgba,c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for c in mavcolors:\n",
    "    rgba = mcolors.to_rgba(c,1.0)\n",
    "    h = mcolors.to_hex(rgba)\n",
    "    print(h,rgba,c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib as mpl\n",
    "colors = [item['color'] for item in mpl.rcParams['axes.prop_cycle']]\n",
    "colors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "type(mpl.rcParams['axes.prop_cycle'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from cycler import cycler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ccs = ['#40e0d0','#ffd700','#ff00ff']\n",
    "ccyc = cycler(color=ccs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "type(ccyc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "['#40e0d0','#ffd700','#ff00ff',\n",
    " '#1f77b4','#ff7f0e','#2ca02c',\n",
    " '#d62728','#9467bd','#8c564b',\n",
    " '#e377c2','#7f7f7f','#bcbd22',\n",
    " '#17becf']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ohlc='inheri'\n",
    "ohlc == 'inherit'[0:len(ohlc)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
